package com.aos.client;

import com.aos.util.Result;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


/**
 * Created by fangzhipeng on 2017/5/27.
 */

@FeignClient(value = "uaa-service-gov")
public interface AuthServiceClient {

//    @PostMapping(value = "/oauth/token")
//    JWT getToken(@RequestHeader(value = "Authorization") String authorization, @RequestParam("grant_type") String type,
//                 @RequestParam("username") String username, @RequestParam("password") String password);
//    JWT getToken(@RequestHeader(value = "Authorization") String authorization, @RequestParam("grant_type") String type);
    //用户数据同步
    @RequestMapping(value = "/user/synchro",method = RequestMethod.POST)
    String data(
            @RequestParam("username") String username,
            @RequestParam("realname") String realname,
            @RequestParam("password") String password,
            @RequestParam("service_id") String service_id,
            @RequestParam("data_type") String data_type,
            @RequestParam("login_type") String login_type,
            @RequestParam("uid") Long uid,
            @RequestParam("salt") String salt
    );

    @PostMapping(value = "/entry/check")
    Map getToken(
            @RequestParam("username") String username,
            @RequestParam("password") String password,
            @RequestParam("login_type") String login_type,
            @RequestParam("service_id") String service_id,
            @RequestParam("secret") String secret
    );

    @PostMapping(value = "/oauth/revoke-token")
    String logout(
            @RequestParam("access_token") String accessToken
    );


}



